#!/usr/bin/php -q
<?
echo "plugin_setinfo 'ping' 'lala the third' 7\n";
echo "command_add shutup shutup\n";
$a = NULL;
for(;;){
    $arr = array(STDIN);
    stream_select($arr,$a,$a,1);
    if (isset($arr[0])){
        $o = fread($arr[0],128);
        $boom = explode(" ",$o);
        switch($boom[0]){
        case "err":
            continue;
        case "shutup":
            exit(0);
        default:            
            echo "from stdin: ".$o;
        }
    } else {
        echo "evt type ping\n";
    }
}
?>
